# Copyright (c) SandboxAQ. All rights reserved.
# SPDX-License-Identifier: AGPL-3.0-only

load("//common/rules/mkdocs:rules.bzl", "mkdocs_project", "mkdocs_tree")
load("@bazel_skylib//rules:build_test.bzl", "build_test")

mkdocs_tree(
    name = "mkdocs_homepage",
    srcs = glob(["docs/**/*"]),
)

mkdocs_project(
    name = "docs",
    srcs = [
        ":mkdocs_homepage",
        "//docs/concepts:mkdocs",
        "//docs/examples:mkdocs",
        "//docs/images:mkdocs",
        "//docs/protobuf:mkdocs",
        "//docs/protobuf/api:mkdocs",
        "//docs/protobuf/api/v1:mkdocs",
        "//examples:mkdocs",
        "//examples/go/echo_tls_server:mkdocs",
        "//examples/go/tls_client:mkdocs",
        "//examples/python/echo_tls_server:mkdocs",
        "//examples/python/tls_client:mkdocs",
        "//examples/rust/echo_tls_server:mkdocs",
        "//examples/rust/tls_client:mkdocs",
        "//go/io:mkdocs",
        "//pysandwich:mkdocs",
        "//rust:mkdocs",
        "//sandwich_c:mkdocs",
    ],
    config = "mkdocs.yml",
)

build_test(
    name = "sandwich_docs_build_test",
    targets = [
        ":docs",
    ],
)
